//
//  TT_OSSManager.h
//  ZKGX
//
//  Created by 王洋 on 2020/3/12.
//  Copyright © 2020 王洋. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, BA_resizeType) {
    BA_resizeType_none,         //用于不需要图片压缩的场景    一般用于点击放大的图片，需要保证图片细腻度
    BA_resizeType_max,          //1000 用于60%~100%宽度的图          大多数为banner、详情主图
    BA_resizeType_pro,          //500 用于30%~60%宽度的图              大多为列表套餐婚品图
    BA_resizeType_plus,         //300 用于10%~30%宽度的图              大多为小图标
    BA_resizeType_small,        //100 用于1%~10%宽度的图            极小的图标【比较少用】
    BA_resizeType_webP,         //webp

};

@interface TT_OSSManager : NSObject 

typedef void (^finishBlock)(id data);
typedef void (^FailedBlock)(NSError *error);

@property(copy,nonatomic)finishBlock finishBlock;
@property(copy,nonatomic)FailedBlock failedBlock;


typedef void (^UploadProgress)(NSInteger index);

+ (instancetype)manager;

+ (NSString *)reformWebPUrl:(NSString *)url;

+ (NSString *)reSourceUrl:(NSString *)url type:(BA_resizeType)type;

+ (NSString *)resizeSourceUrl:(NSString *)url width:(CGFloat)width;

//图片url去掉后缀
+ (NSString *)clearSourceUrl:(NSString *)url;

//根据url下载图片
+ (void)cacheSourceUrl:(NSString *)url;

+ (NSString *)deviceAutoPic:(NSString *)url;

- (void)selectPhotoFromVC:(UIViewController *)vc photoCount:(NSInteger)count AndUploadServerComption:(void (^)(NSArray *urlArray))comption;

@end

NS_ASSUME_NONNULL_END
